package com.ruoyi.hasor;

import net.hasor.core.ApiBinder;
import net.hasor.core.DimModule;
import net.hasor.db.JdbcModule;
import net.hasor.db.Level;
import net.hasor.spring.SpringModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

/**
 * @Classname ExampleModule
 * @Description TODO
 * @Author h21448-hxtq
 * @Date 2020-04-20 09 : 42
 * @Version 1.0
 */
@DimModule
@Component
public class ExampleModule implements SpringModule {

    @Autowired
    @Qualifier("masterDataSource")
    private DataSource dataSource;


    @Override
    public void loadModule(ApiBinder apiBinder) throws Throwable {
        apiBinder.installModule(new JdbcModule(Level.Full,this.dataSource));
    }


}
